package com.atguigu.boot.bean;

import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.format.annotation.DateTimeFormat;
import org.springframework.stereotype.Component;

import java.util.*;

@Component
@ConfigurationProperties(prefix = "actor")
/**
 * 次注解表示将指定的yml或者properties问价中以actor开头的
 * 属性对应的值绑定到当前pojo对象对应的属性上（属性名要保持一致）
 */
public class Actor {
//    @Value("${actor.id}")
    private Integer aid;
//    @Value("${actor.name}")
    private String actorName;
//    @Value("${actor.gender}")
    private boolean gender;
//    @Value("${actor.birth}")
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    private Date birth;

    private  Book book;
    private  Book2 book2;
    private Map map;
    private Map map2;
    private List nums;
    private Set set;
    private String[] strs;
    private List<Book> books;

    public List<Book> getBooks() {
        return books;
    }

    public void setBooks(List<Book> books) {
        this.books = books;
    }

    public List getNums() {
        return nums;
    }

    public void setNums(List nums) {
        this.nums = nums;
    }

    public Set getSet() {
        return set;
    }

    public void setSet(Set set) {
        this.set = set;
    }

    public String[] getStrs() {
        return strs;
    }

    public void setStrs(String[] strs) {
        this.strs = strs;
    }

    public Map getMap2() {
        return map2;
    }

    public void setMap2(Map map2) {
        this.map2 = map2;
    }

    public Map getMap() {
        return map;
    }

    public void setMap(Map map) {
        this.map = map;
    }

    public Book2 getBook2() {
        return book2;
    }

    public void setBook2(Book2 book2) {
        this.book2 = book2;
    }

    public Book getBook() {
        return book;
    }

    public void setBook(Book book) {
        this.book = book;
    }


    @Override
    public String toString() {
        return "Actor{" +
                "aid=" + aid +
                ", actorName='" + actorName + '\'' +
                ", gender=" + gender +
                ", birth=" + birth +
                ", book=" + book +
                ", book2=" + book2 +
                ", map=" + map +
                ", map2=" + map2 +
                ", nums=" + nums +
                ", set=" + set +
                ", strs=" + Arrays.toString(strs) +
                ", books=" + books +
                '}';
    }

    public void setActorName(String actorName) {
        this.actorName = actorName;
    }

    public void setGender(boolean gender) {
        this.gender = gender;
    }

    public void setBirth(Date birth) {
        this.birth = birth;
    }

    public Integer getAid() {
        return aid;
    }

    public void setAid(Integer aid) {
        this.aid = aid;
    }

    public String getActorName() {
        return actorName;
    }

    public boolean isGender() {
        return gender;
    }

    public Date getBirth() {
        return birth;
    }
}
